<?
require("config.php");
$langname = 'coaching';

require("header.php");

require($rela_path . "bin/country.php");

$table = "course_trainer_info";

$field = array(

"id",
"name",
"email",
"brief",

);

$exp=" AND accept=0 order by aorder asc";

$r = limitQuery($table,$field,$exp);


if (NULL!=$action){

	$table="course_coach_booking";

   $field = array(
	"code",
	"contact_date",
	"name",
	"phone",
	"fax",
	"email",
	"city",
	"country",
	"trainer",
	"booking_time",
	"via",
	"message",
			"lastname",
"company",
"position",
"mobile",
"address",
"street",
"state",
"zip",

	);


   for ($i=0;$i<count($trainer);$i++){

		if ($trainer[$i]) {
		
			if  ($i<(count($trainer)-1)){
				$Trainer .= $trainer[$i] . ";";
			}else{
				$Trainer .= $trainer[$i];
			}

		}

   }

   $content = array(
	$Code,
    date("Y-m-d"),
	$Name,
	$Phone,
	$Fax,
	$Email,
	$City,
	$Country,
	$Trainer,
	"$myYear-$myMonth-$myDay $myTime",
	$Via,
	$Message,
			$Lastname,
$Company,
$Position,
$Mobile,
$Address,
$Street,
$State,
$Zip,

	);

   myInsert($table,$field,$content);


   $status = "Thank you for your booking. We will contact you soon.";

}



$Query="Select content from course_coach_booking_content limit 1";
$r1=myQuery($Query);

$Content=$r1[0][0];

?>














<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 

    <td width="186" valign="top"> 
      <?require("nav.php")?>
    </td>
    <td width="11"><img src="images/shim.gif" width="11" height="1"></td>
    <td valign="top"> 
      <?require("menu.php")?>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td align="right"><table width="100%" border="0">
              <tr> 
                <td height="50" class="header">&gt;&gt; Coach Booking</td>
              </tr>
            </table></td>
        </tr>
      </table>



      <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr> 
          <td>In the world of sports, Coaching has being used for many years with 
            proven significant results. Coaching is not only accepted but also 
            becoming a natural essence of a high performance athlete. Nowadays, 
            coaching is getting more and more common in personal and professional 
            contexts as people know that they can get the best out of their life 
            from it.
            <p>So if you would like to:</p>
            <ul>
			<li>Perform your best and create value at work</li>
              <li> Identify who is fit for you and build the relationship you want</li>
              <li>Explore more opportunities for yourself and attract the wealth 
              you deserve</li>
              <li> Know how to set powerful goals and achieve them at ease</li>
              <li>Create better health and live your life vivaciously</ul>
            <p>Then our coaching is for you!<br><br>

<?=$Content?>
<BR><BR>

<!--<a href="#" onClick="window.open('testimonial.php?id=<?=$r[$i][0]?>','','scrollbars=yes,resizable=yes,width=400,height=400')"><u>Testimonial</u></a>-->
            </p></td>
        </tr>
      </table>
<script language="JavaScript"> 
<!-- 
function checkForm1(theform) { 

if (theform.Name.value=="") { 
    theform.Name.focus(); 
    alert("Please enter your name."); 
    return false; } 
	
if (theform.Lastname.value=="") { 
    theform.Lastname.focus(); 
    alert("Please enter your Family Name."); 
    return false; } 
	
if (theform.Company.value=="") { 
    theform.Company.focus(); 
    alert("Please enter your Company."); 
    return false; } 
	
if (theform.Position.value=="") { 
    theform.Position.focus(); 
    alert("Please enter your Position."); 
    return false; } 
if (validate_email(theform.Email.value)== false){ 
    theform.Email.focus(); 
    alert("Invalid Email."); 
    return false; } 
	
if (theform.Phone.value=="") { 
    theform.Phone.focus(); 
    alert("Please enter your phone."); 
    return false; }

if (theform.Street.value==""){ 
    theform.Street.focus(); 
    alert("Please enter Street."); 
    return false; } 
if (theform.Zip.value==""){ 
    theform.Zip.focus(); 
    alert("Please enter Zip."); 
    return false; } 
if (theform.City.value==""){ 
    theform.City.focus(); 
    alert("Please enter City."); 
    return false; } 
if(theform.reg_code.value ==""){
	theform.reg_code.focus();
    alert("Please enter verify code."); 
    return false; }

if(!RadioChecked("Coaching_type"))
{
	alert("Please select the Coaching Type."); 
	return false;
}
}

function RadioChecked(RadioName)
{
	var eless = document.getElementsByName(RadioName);
	var rtn = false;
	for(var i=0;i<eless.length;i++)
	{
		if(eless[i].checked)
		{
			rtn = true;
			break;
		}
	}
	return rtn;
}

function CountryChange(sel,trid,sid)
{
	if(sel.value == "Denmark")
	{
		document.getElementById(trid).style.display="none";
		document.getElementById(sid).value="";
	}
	else
	{
		document.getElementById(trid).style.display="";
	}
}
//--> 
</script>
      <form name="form1" method="post" action="coaching_booking1.php" onSubmit="return checkForm1(this)">
        <br>
        <table width="95%" border="0" align="center" cellpadding="5" cellspacing="0">
          <tr> 
            <td colspan="2" valign="top"> <hr size="1"> </td>
          </tr>
          <tr> 
            <td colspan="2" valign="top"><b>Please select the coach you want 
              to book :</b></td>
          </tr>



          <?for ($i=0;$i<count($r);$i++){?>
          <tr> 
            <td width="76%" valign="top"> <input type="checkbox" name="trainer[]" value="<?=$r[$i][1]?>"> 
              <?=$r[$i][1]?>
            </td>
            <td width="24%" valign="top"><a href="mailto:<?=$r[$i][2]?>"><u>E-mail</u></a> 
              <a href="#" onClick="window.open('bio.php?id=<?=$r[$i][0]?>','','scrollbars=yes,resizable=yes,width=600,height=600')"><u>Bio</u></a> 
            </td>
          </tr>
          <?}?>



          <tr> 
            <td colspan="2" valign="top"> <hr size="1"> </td>
          </tr>
          <tr> 
            <td colspan="2"><b>Your Personal Information</b></td>
          </tr>
          <tr> 
            <td colspan="2">Please complete the information below. The fields 
              that are essential for booking are indicatied with an (<font color="red">*</font>). 
              Your information will be kept secure.</td>
          </tr>
        </table>
        <br>
        <table width="95%" border="0" align="center" cellpadding="5" cellspacing="0">
          <tr> 
            <td colspan="2"> <input type="text" name="Name" size="30" class="text"> 
              <font color="red">*</font> 
              First Name</td>
          </tr>
          <tr>
            <td colspan="2"><input name="Lastname" type="text" class="text" id="Lastname" size="30" />
              <font color="red">*</font> Last Name</td>
          </tr>
          <tr>
            <td colspan="2"><input name="Company" type="text" class="text" id="Company" size="30" />
              <font color="red">*</font> Company </td>
          </tr>
          <tr>
            <td colspan="2"><input name="Position" type="text" class="text" id="Position" size="30" />
              <font color="red">*</font> Position / Profession </td>
          </tr>
          <tr>
            <td colspan="2"><input type="text" name="Email" size="30" class="text" />
              <font color="red">* </font>E-mail</td>
          </tr>
          <tr> 
            <td colspan="2"> <input type="text" name="Phone" size="30" class="text"> 
              <font color="red">*</font> Phone</td>
          </tr>
          <tr> 
            <td colspan="2"> <input name="Mobile" type="text" class="text" id="Mobile" size="30">
              <font color="red">*</font> Mobile </td>
          </tr>
          
          <tr> 
            <td colspan="2"><font color="red">*</font>Company address</td>
          </tr>
          <tr>
            <td colspan="2"><input name="Street" type="text" class="text" id="Street" size="30" /><font color="red">*</font> Address / Street </td>
          </tr>
          <tr>
            <td colspan="2"><input name="Zip" type="text" class="text" id="Zip" size="30" /><font color="red">*</font> Zip</td>
          </tr>
          <tr>
            <td colspan="2"><input type="text" name="City" size="30" class="text" /><font color="red">*</font> City</td>
          </tr>
          <tr id="trCState" style="display:none">
            <td colspan="2"><input name="State" type="text" class="text" id="State" size="30" />
            State</td>
          </tr>
          <tr> 
            <td colspan="2"><?print(FFPCountry("Denmark", "Ccountry","CountryChange(this,'trCState','State');"))?> <font color="red">*</font> Country</td>
          </tr>
          <tr>
            <td colspan="2">Private Address</td>
          </tr>
          <tr>
            <td colspan="2"><input name="Pstreet" type="text" class="text" id="Pstreet" size="30" />Address / Street</td>
          </tr>
          <tr>
            <td colspan="2"><input name="Pcity" type="text" class="text" id="Pcity" size="30" />City</td>
          </tr>
          <tr id="trPState" style="display:none">
            <td colspan="2"><input name="Pstate" type="text" class="text" id="Pstate" size="30" />State</td>
          </tr>
          <tr>
            <td colspan="2"><input name="Pzip" type="text" class="text" id="Pzip" size="30" />Zip</td>
          </tr>
          <tr> 
            <td colspan="2"><?print(FFPCountry("Denmark", "Pcountry","CountryChange(this,'trPState','Pstate');"))?>Country / Region </td>
          </tr>
          <tr>
            <td colspan="2"><input name="reg_code" type="text" class="text" id="reg_code" size="10" /> 
             <img src="authimg.php?type=1" border="0" />   <font color="red">*</font> Verify  Code </td>
          </tr>
          <tr> 
            <td colspan="2"><?print(FFPtime1(date("Y-m-d H:i")))?> <font color="red">* 
              </font>Booking Time (Local)</td>
          </tr>
          
          <tr> 
            <td width="20%" valign="top">Coaching via</td>
            <td width="80%"><input name="Via" type="radio" value="Interview" checked>
              In Person <br> <input type="radio" name="Via" value="Phone">
          By Phone <br>          </tr>

            <TR>
              <TD height="28" valign="top">Coaching Type</TD>
              <TD>
			  <table border="0" cellpadding="0" cellspacing="0" width="100%">
<?
$Query="select 
	  code,
	  content,
	  testimonial,
	  publish,
	  description1,
	  currency1,
	  fee1,
	  publish1,
	  description2,
	  currency2,
	  fee2,
	  publish2,
	  description3,
	  currency3,
	  fee3,
	  publish3,
	  description4,
	  currency4,
	  fee4,
	  publish4,
	  description5,
	  currency5,
	  fee5,
	  publish5,
	  description6,
	  currency6,
	  fee6,
	  publish6,
	  description7,
	  currency7,
	  fee7,
	  publish7,
	  description8,
	  currency8,
	  fee8,
	  publish8,
	  description9,
	  currency9,
	  fee9,
	  publish9,
	  description10,
	  currency10,
	  fee10,
	  publish10 
from course_coach_booking_content limit 1";
$r=myQuery($Query);

		$Code=$r[0][0];
		$Content=$r[0][1];
		$Testimonial=$r[0][2];
		$Publish=$r[0][3];
		$Description1=$r[0][4];
		$Currency1=$r[0][5];
		$Fee1=$r[0][6];
		$Publish1=$r[0][7];
		$Description2=$r[0][8];
		$Currency2=$r[0][9];
		$Fee2=$r[0][10];
		$Publish2=$r[0][11];
		$Description3=$r[0][12];
		$Currency3=$r[0][13];
		$Fee3=$r[0][14];
		$Publish3=$r[0][15];
		$Description4=$r[0][16];
		$Currency4=$r[0][17];
		$Fee4=$r[0][18];
		$Publish4=$r[0][19];
		$Description5=$r[0][20];
		$Currency5=$r[0][21];
		$Fee5=$r[0][22];
		$Publish5=$r[0][23];
		$Description6=$r[0][24];
		$Currency6=$r[0][25];
		$Fee6=$r[0][26];
		$Publish6=$r[0][27];
		$Description7=$r[0][28];
		$Currency7=$r[0][29];
		$Fee7=$r[0][30];
		$Publish7=$r[0][31];
		$Description8=$r[0][32];
		$Currency8=$r[0][33];
		$Fee8=$r[0][34];
		$Publish8=$r[0][35];
		$Description9=$r[0][36];
		$Currency9=$r[0][37];
		$Fee9=$r[0][38];
		$Publish9=$r[0][39];
		$Description10=$r[0][40];
		$Currency10=$r[0][41];
		$Fee10=$r[0][42];
		$Publish10=$r[0][43];
?>
<!--<input name="Coaching_type" type="radio" value="0" checked>None<br>-->

<?

for ($i=1;$i<11;$i++){

	$v1="Currency$i";
	$v2="Fee$i";
	$v3="Description$i";
	$v4="Publish$i";

	if ($$v4==0 && $$v2>=0){
		//echo $$v1 . " " .$$v2 ." <span class=note>" . $$v3 . "</span><br>";
		$actived = ($i==1) ? "checked" : "";

		echo "<tr><td width=\"60%\" align=\"left\"><input name=\"Coaching_type\" type=\"radio\" value=\"$i\" $actived>" . 
		$$v3 . "</td><td align=\"left\" width=\"40%\">" .$$v2 . " - " . $$v1 . "</td></tr>";
	}

}
?>				</table></TD>
            </TR>
        </table>
        <br>
        <table width="95%" height="20" border="0" align="center" cellpadding="1" cellspacing="0">
          <tr> 
            <td>
			
Remarks: (You may brief us about your goal / outcome from the coaching service you wish)<br> <br> 			
			<textarea name="Message" cols="40" rows="10" class="text"></textarea> <br> 
              <br> <input type="submit" name="Submit3" value="Send Booking" class="button"> 
			  <input type="hidden" name="action" value="add"></td>
          </tr>
        </table>
      </form>
      <br>
      <table width="100%" border="0" align="center">
        <tr>
          <td>Coaching booking will be confirmed via email. Our coach will contact 
            you for arranging coaching sessions at your earliest convenience. 
          </td>
        </tr>
      </table>
      <br> <br>
      <br> </td>
    <td width="11"><img src="images/shim.gif" width="11" height="1"></td>
    <td width="173" valign="top">
	
	
<?require("list.php")?>	 
	  
	  
    </td>

  </tr>
</table>





<?require("footer.php")?>	